package com.study.transform;

/**
 * 子类父类的转换
 */
public class TestObjectConvert {

    public static void main(String[] args) {
        test1();
    }

    private static void test1(){
        Fruit apple=new Apple();
        apple.colour();
    }

    static class Fruit{
        public void colour(){
            System.out.println("我是水果他爹，无色！！！");
        }
    }

    static class Apple extends Fruit{
        @Override
        public void colour(){
            System.out.println("我是苹果红色！！！");
        }
    }
}
